package com.daoyintech.utils;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

/**
 * Created by xuzhaolin on 15/12/29.
 */
public class HongBaoUtil {

    private static final long min = 1000000000;
    private static final long max = 2000000000;

    public static int getRandomMoney() {

//        return ThreadLocalRandom.current().nextInt(100,1100);
        return 100;
    }

    public static long getRandomOrderNumber() {
          return ThreadLocalRandom.current().nextLong(min,max+1);
    }


    public static String getNonceStr() {

        return getRandomString(32);
    }

    public static String getRandomString(int length){
        String base = "abcdefghijklmnopqrstuvwxyz0123456789";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for(int i = 0;i <length;i++){
            int number = ThreadLocalRandom.current().nextInt(base.length());
            sb.append(base.charAt(number));
        }
        return sb.toString();
    }


}
